package com.github.willisaway.core.config;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Configuration;
import org.springframework.core.env.Environment;

import lombok.Data;

@Configuration
@Data
public class SystemConfig {
    private static Logger logger = LoggerFactory.getLogger(SystemConfig.class);
    @Autowired
    private Environment env;
    public String getProfile(String seprator) {
        if(seprator==null) {
            seprator="";
        }
        String[] profiles = env.getActiveProfiles();
        String profile = "";
        if(profiles.length > 0) {
            profile = seprator + profiles[0];
        }
        return profile;
    }
    
//    @Value("${system.cache.enable}")
//    public boolean cacheEnable = true;
}
